package com.jintian.smart.kernel.flowable.domain.entity;

import java.util.List;
import java.util.Map;

import com.jintian.smart.kernel.core.annotation.orm.SimpleQuery;
import com.jintian.smart.kernel.flowable.domain.model.BizRuleImpl;
import com.jintian.smart.kernel.flowable.domain.model.StartRuleImpl;
import com.jintian.smart.kernel.orm.entity.BaseBaseEntity;
import com.jintian.smart.kernel.orm.entity.annotation.JSONMapper;
import com.jintian.smart.kernel.orm.impl.BizTableImpl;
import jakarta.validation.constraints.NotNull;
import org.beetl.sql.annotation.entity.Column;
import org.beetl.sql.annotation.entity.Table;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 业务流程表 MdaBizFlow entity gen at 2023-02-24
 */

@Data
@EqualsAndHashCode(callSuper = false)
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Table(name = "MDA_BIZ_FLOW")
@SimpleQuery("com.jintian.mda.flow.domain.query.BizFlowQuery")
public class BizFlow extends BaseBaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 业务编码
     */
    @NotNull
    @Column(name = "FLOW_CODE", comment = "业务编码")
    private String flowCode;
    /**
     * 流程版本
     */
    @NotNull
    @Column(name = "FLOW_VERSION", comment = "流程版本")
    private Integer flowVersion;
    /**
     * 流程名称
     */
    @NotNull
    @Column(name = "FLOW_NAME", comment = "流程名称")
    private String flowName;
    /**
     * 流程模型
     */
    @Column(name = "FLOW_MODEL", comment = "流程模型")
    private String flowModel;
    /**
     * 业务id
     */
    @Column(name = "BIZ_ID", comment = "业务id")
    private String bizId;

    @Column(name = "biz_entity", comment = "业务实体类")
    private String bizEntity;
    /**
     * 静默流转
     */
    @Column(name = "silence", comment = "静默流转")
    private Integer silence;

    @Column(name = "bizTables", comment = "业务数据")
    @JSONMapper
    private List<BizTableImpl> bizTables;

    @Column(name = "bizRules", comment = "业务规则")
    @JSONMapper
    private List<BizRuleImpl> bizRules;

    @Column(name = "context_variables", comment = "流程变量")
    @JSONMapper
    private Map<String, String> contextVariables;
    @Column(name = "TASK_ATTRIBUTES", comment = "任务属性")
    @JSONMapper
    private Map<String, String> taskAttributes;
    @Column(name = "startRules", comment = "启动规则")
    @JSONMapper
    private List<StartRuleImpl> startRules;

    @Column(name = "FORM_URL", comment = "表单URL")
    private String formUrl;

    @Column(name = "LC_CODE", comment = "浪潮工作流编号")
    private String lcCode;

    @Column(name = "START_ROLE", comment = "启动角色")
    private String startRole;

}